<div class="IMChat-model-bd IMChat-new-gchat">

	<!-- head -->
	<div class="box-head" ng-if="ngDialogData.mode != 'addgroupmember'">
		<span class="close-model win" ng-click="closeCreateGroupChat($event)"></span> 创建群组
	</div>

	<div class="box-head" ng-if="ngDialogData.mode == 'addgroupmember'">
		<span class="close-model win" ng-click="closeCreateGroupChat($event)"></span> 添加成员
	</div>

	<!-- body -->
	<div class="box-bd cl">
		<!-- left -->
		<div class="l-blk">

			<!--群组名称-->
			<input class="set-gname" ng-model="project_name" placeholder="群组名称" maxlength="100" ng-show="ngDialogData.mode != 'addgroupmember'">

			<!-- 参与人 -->
			<div class="search-person-input search-person-affiliated" ng-class="{true:'addgroupmember'}[ngDialogData.mode == 'addgroupmember']">

				<h6 class="title y mr10" ng-if="!!multipleDemo.selectedPeopleWithGroupBy.length" ng-bind="'已选择'+multipleDemo.selectedPeopleWithGroupBy.length+'人'"></h6>
				<h6 class="title">群成员</h6>

				<ui-select multiple ng-model="multipleDemo.selectedPeopleWithGroupBy" theme="bootstrap" ng-disabled="disabled" close-on-select="true"  title="搜索名称、拼音、手机号" reset-search-input="true" class="selectAffiliated">
					<ui-select-match  placeholder="搜索名称、拼音、手机号">
						{{$item.name}}
					</ui-select-match>
					<ui-select-choices group-by="someGroupFn" repeat="person in PersonList" refresh="refreshPersons($select.search)" refresh-delay="300" position="down">
						<div class="select-item">
							<div class="rainbow-{{person.name|getFirstLetter}} avt-s-s z" ng-bind="person.name | photoname">
							</div>
							<span ng-bind-html="person.name + '    ' + person.email  | highlight: $select.search"></span>
						</div>
					</ui-select-choices>
				</ui-select>
			</div>

		</div>

		<!-- right -->
		<div class="r-blk">
			<!--组织架构搜索-->
			<!--<input class="organizational-search set-gname" ng-model="organizational_search" placeholder="搜索联系人/部门"/>-->

			<div class="pick-tab">

				<div class="tab-head text-ellipsis" ng-bind="'我的联系人'">
				</div>

				<!-- 一级部门：公司 -->
				<div class="organizationContainer">

					<!-- 二级部门 -->
					<div class="departItem"  ng-repeat="entity in showList">
						<!-- 部门标题 -->
						<div class="departTitle cl level-{{entity.level}}">
							<span class="arrow y" ng-click="toggleDepartMembers($event,entity.id)" ng-class="{false: '', true: 'open'}[!!entity.show]"></span>
						    <span class="name text-ellipsis"  ng-bind="entity.name"></span>
						</div>

						<div ng-if="entity.show">
								<!-- 直属成员 -->
								<div class="membersItem"  ng-if="!!entity.members && entity.members.length">
									<div class="check-all level-{{entity.level+1}}">
										<input id="selectAll_{{entity.id}}" type="checkbox" ng-model="entity.selectAll" ng-checked="seleteDeptAllFlag[{{entity.id}}]" ng-click="selectDeptAll($event,entity.id)" style="display:none"/>
										<label for="selectAll_{{entity.id}}"></label>全选
									</div>
									<ul class="user-list">
										<li ng-repeat="member in entity.members" ng-class="{false: 'unchecked', true: 'checked'}[!!member.checktype]" class="level-{{entity.level+1}}" ng-click="addGroupLeaguer($event,member)">
											<div class="rainbow-{{member.name|getFirstLetter}} avt-s-s">
												<span></span><span style="color: White;" ng-bind="member.name | photoname"></span>
											</div>
											{{member.name}}
										</li>
									</ul>
								</div>
						</div>
					</div>


				</div>
			</div>
		</div>
	</div>

	<!-- footer -->
	<div class="box-foot">
		<span class="confirmBtn y" ng-click="createChatGroup($event)" ng-if="ngDialogData.mode != 'addgroupmember'">创建</span>
		<span class="confirmBtn y" ng-click="addMembers($event,group)" ng-if="ngDialogData.mode == 'addgroupmember'">添加</span>
		<span class="cancelBtn y" ng-click="closeCreateGroupChat($event)">取消</span>
	</div>
</div>
